<?php

header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');   
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');    
//require_once 'library/base/profiler.class.php';

require_once('config/config.php');
require_once('include/function.php');

require_once('library/class.phpmailer.php');

//参数转义处理
$_POST = daddslashes($_POST);
$_GET  = daddslashes($_GET);

$get_mod    = !empty($_GET['mod']) ? $_GET['mod'] : 'index';
$act        = !empty($_GET['act']) ? $_GET['act'] : 'index';

try
{
    $mod = 'controller_' . $get_mod;
    /*
    //权限判断
	if ( $get_mod != "login" )
    {
        $module_login = new module_login();
        if ( !$module_login->is_login() ) 
        {
            $crt_base = new controller_base();
            $crt_base->_alert( '', "?mod=login&act=index&bmod={$get_mod}&bact={$act}" );

        }
    	//通过用户类型得到用户所有权限
    	$module_purview = new module_purview();
    	$function_id_array = $module_purview->get_purview_by_user_type( );
        
    	//判断是否有权限	
    	$check_purview = $module_purview->check_purview( $function_id_array, $mod, $act );
        if( !$check_purview ) die( '没有权限' );
    }
    */
    
	//执行用户操作	
	$class = new $mod();
	$class->$act($_GET);
}
catch (Exception $e)
{
	if (DEBUG)
	{
		echo 'file:' . $e->getFile();
		echo 'line:' . $e->getLine();
	}
	die($e->getMessage());
}
